#ifndef	TOOLBARITME_H_H_H_H_
#define TOOLBARITME_H_H_H_H_
#include <string>
#include <QStringList>
class QAction;
class QToolBar;

class ToolBarItem
{
public:
	ToolBarItem(void);
	ToolBarItem(ToolBarItem* item);
	~ToolBarItem(void);

public:
	void setCommand(const std::string& );
	std::string command()const;

	bool hasItem()const;
	ToolBarItem* findItem(const std::string&);
   ToolBarItem* copy()const;
	int count()const;

	void appendItem(ToolBarItem*item);
	bool insertItem(ToolBarItem* befroe,ToolBarItem* item); 
	void removeItem(ToolBarItem* item);
	void clear();

	ToolBarItem& operator << (ToolBarItem* item);
	ToolBarItem& operator << (const std::string& command);

	QList<ToolBarItem*> getItems()const;

private:

	QList<ToolBarItem*> _items;
	std::string _name;
};

class ToolBarManager
{
public:
	ToolBarManager();
	~ToolBarManager();
public:

	static ToolBarManager* getInstance();
	void destruct();

public:
	void setup(ToolBarItem* items);
	void setup(ToolBarItem* item,QToolBar* toolbar);
    QList<QToolBar*> toolBars()const;
	QToolBar* findToolBar(const QList<QToolBar*>&,const QString&)const;
	QAction* findAction(const QList<QAction*>&,const QString&)const;

private:
	QStringList  toolbarNames;
	static ToolBarManager* _instance;
};
#endif